﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ATW.MT.BUS;
using ATW.MT.CommonClass;

namespace ATW.MT.BaseManage
{
    public partial class AuthorManage : CommonPage
    {
        bus_D_user user = new bus_D_user();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
        private void BindData()
        {
            try
            {
                string name=txtName.Value.Trim();
                DataTable dt = user.LevelPagerQuery(name, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
                if (dt != null && dt.Rows.Count > 0)
                {
                    AspNetPager1.RecordCount = Convert.ToInt32(dt.Rows[0]["totalpagesize"]);
                }
                else
                {
                    AspNetPager1.RecordCount = 0;
                }
                rpList.DataSource = dt;
                rpList.DataBind();
            }
            catch (Exception ex)
            {
 
            }
        }


        protected void btnSearch_Click(object sender,EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            BindData();
        }
        protected void AspNetPager1_pageChanged(object sender, EventArgs e)
        {
            BindData();
        }
    }
}